﻿@{
    ViewBag.Title = "Search";
}

@model IEnumerable<SimpleApp.Models.INSPIRATION>
<h2>Search</h2>


<div class='row'>
<div class="col-lg-3">
    <div class="input-group">
      <input type="text" class="form-control" id='txtName'>
      <span class="input-group-btn">
        <button class="btn btn-default" type="button" id='btnSearch'>SEARCH!</button>
      </span>
    </div><!-- /input-group -->
  </div>
</div>

<div class='row'>
<div class="col-lg-7">
<table class="table table-striped">
   <thead>
      <tr>
         <td>ID</td>
         <td>NAME</td>
       
      </tr>
   </thead>
   <tbody>
    
    @foreach (var item in Model)
    {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.ID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.NAME)
        </td>
       
        <td>
            <a  href="/SimpleApp/inspire/delete/@item.ID">DELETE</a>
        </td>
    </tr>
    }
   </tbody>

</table>
</div>
</div>

<script>
    $(document).ready(function () {
        $('#btnSearch').click(function () {
            var name = $('#txtName').val();
            window.location = "/SimpleApp/inspire/search/?name=" + name;
        });

    });
</script>

